<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    //---------------------------------------------------
    const promises = [2,3,,5,7,11,13].map(function(id) {
      return getJSON('/post/'+id+".json");
    })

    Promise.all(promise).then(function(posts) {

    }).catch(function(reason) {

    })
    //---------------------------------------------------
    const databasePromise = connectDatabase();

    const booksPromise = databasePromise.then(findAkkBooks);
    const userPromise= databasePromise.then(getCurrentUser);
    Promise.all([
      booksPromise,
      userPromise
    ]).then(([books,user])=> pickTopRecommendations(books,user))
  </script>
</body>
</html>